home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 19 / Amiga Plus Leser CD 19.iso / Tools / ShareMailGiftware / PhotoFolio2.1Update2 / Update-PhotoFolio < prev   
Encoding:
Text File  |  2002-11-17  |  10.9 KB  |  427 lines

  1. ; Update PhotoFolio from 2.0 to 2.1
  2. ; $VER: Update-PhotoFolio V1.2 (14.12.2000)
  3. ; © 2000 Steeple Software
  4. ;
  5.  
  6. (set #catalog 0) ; english language is default
  7.  
  8. ; *********************** Find the current language
  9. (set #i 0)
  10. (while (set #thisfile (select #i
  11.         "english" "italiano" "deutsch" "español" "czech" "català" "dansk" "français"
  12.         "hrvatski" "nederlands" "norsk" "polski" "português"
  13.         "russian" "srpski" "suomi" "svenska" "ÃeÓtina"
  14.         ""))
  15.     (
  16.         (if (= @language #thisfile)
  17.             (
  18.                 (set #catalog #i)
  19.                 (set #catalogname #thisfile)
  20.             )
  21.         )
  22.         (set #i (+ #i 1))
  23.     )
  24. )
  25.  
  26. ; *********************** Query user for their language, using system as default
  27. ;(set #catalog
  28. ;    (askchoice
  29. ;        (prompt "Select your native language (language for installer)")
  30. ;        (help @askoptions-help)
  31. ;        (choices "English" "Italiano" "Deutsch" "Español" "Czech")
  32. ;        (default #catalog)
  33. ;    )
  34. ;)
  35.  
  36. ; *********************** Reset #catalogname as the user may have changed the language above
  37. ;(if (< #catalog 5)
  38. ;    (
  39. ;        (set #catalogname (select #catalog "english" "italiano" "deutsch" "español" "czech"))
  40. ;    )
  41. ;)
  42.  
  43. ; *********************** Strings common for all languages
  44. (set #HOMEPAGE "http://steeplesoftware.dragonfruit.org")
  45. (set #BLANK "\n")
  46.  
  47. ; *********************** English texts
  48. (set #INITIAL_MESSAGE
  49.     (cat "Steeple Software and Schatztruhe\nPresent PhotoFolio 2.1\n\n"
  50.         "This installation script will update PhotoFolio V2.0 to V2.1\n"
  51.         "and also update other distributed files.\n"
  52.         "It does not perform a complete installation of PhotoFolio. Although\n"
  53.         "you will be asked similar questions as during the original installation\n"
  54.         "process, this update will only work on an existing PhotoFolio installation.\n"
  55.         "\n"
  56.         "Please note that this update process will overwrite\n"
  57.         "all files to be updated, no backup copies will be made."
  58.     )
  59. )
  60. (set #WRONG_INSTALLER_VERSION "\n\n\n\nYou need at least version 42.9 of Installer\nto update PhotoFolio")
  61. (set #WRONG_CPU "\n\n\n\nYou need a 68020 CPU or better\nto run PhotoFolio")
  62. (set #WRONG_OS_VERSION "\n\n\n\nYou need at least AmigaOS V3.0\nto run PhotoFolio")
  63. (set #WRONG_MUI_VERSION "\n\n\n\nYou need at least MUI V3.8\nto run PhotoFolio")
  64. (set #SELECT_PHOTOFOLIO_DIRECTORY "Select the directory where PhotoFolio is installed.")
  65. (set #NOT_FOUND_TRY_AGAIN "PhotoFolio was not found in that directory, try again.")
  66. (set #PROMPT_INSTALL_PPC "Install PPC (WarpOS) modules where appropriate")
  67. (set #PATCHING_PHOTOFOLIO_20 "Patch PhotoFolio from 2.0 to 2.1")
  68. (set #INSTALLING_LIBRARY "\nInstalling PhotoFolio library")
  69. (set #INSTALLING_PATCH "Patching")
  70. (set #PROMPT_INSTALL_IMAGEIOPREFS "\nInstall imageio.library prefs?\n\n(Used to alter the loading formats and\nother parameters of image loading)")
  71. (set #INSTALLING_IMAGEIOPREFS "\nInstalling imageio.library prefs")
  72. (set #PROMPT_INSTALL_JPEGPREFS "\nInstall jpeg.library prefs?\n\n(Used to alter the way jpeg images are loaded)")
  73. (set #INSTALLING_JPEGPREFS "\nInstalling jpeg.library prefs")
  74. (set #PROMPT_INSTALL_CATALOG "\nWhich language catalogs would you like to install?")
  75. (set #INSTALLING_CATALOG "\nInstalling PhotoFolio catalog")
  76. (set #UPDATING_MUI_PREFS "Updating PhotoFolio's MUI preferences")
  77. (set #PHOTOFOLIO_ASSIGN "Adding PhotoFolio assign to S:User-Startup")
  78. (set #UPDATE_COMPLETED
  79.     (cat "PhotoFolio has successfully been updated to V2.1.\n\n"
  80.         "You will need to re-enter your registration code when you run\n"
  81.         "PhotoFolio 2.1 for the first time.\n\n"
  82.         "If you have not registered your copy of PhotoFolio yet, you can do it online at\n"
  83.         #HOMEPAGE "\n\n"
  84.         "Remember to check for new updates at the PhotoFolio homepage:\n"
  85.         #HOMEPAGE
  86.     )
  87. )
  88. (set #YES "Yes")
  89. (set #NO "No")
  90.  
  91. ; ************************* Global procedures
  92. (procedure P_copylib lib destpath newlibname
  93.     (
  94.         (copylib
  95.             (prompt (cat (cat #INSTALLING_LIBRARY " ") (fileonly newlibname)))
  96.             (help @copylib-help)
  97.             (newname newlibname)
  98.             (source lib)
  99.             (dest destpath)
  100.             (confirm)
  101.         )
  102.     )
  103. )
  104.  
  105. (procedure P_copymcc mcc destpath
  106.     (
  107.         (copylib
  108.             (prompt (cat (cat #INSTALLING_MCC " ") (fileonly mcc)))
  109.             (help @copylib-help)
  110.             (source mcc)
  111.             (dest destpath)
  112.             (confirm)
  113.         )
  114.     )
  115. )
  116.  
  117. (procedure P_patchfile #patch #orig #to #msg
  118.     (
  119.         (set #cmd (cat "spatch   -o" (tackon #to (fileonly #orig))
  120.                                " -p" #patch ".pch"
  121.                                " "   "PhotoFolio_2.0:" #orig)
  122.         )
  123.         (working (cat #INSTALLING_PATCH "\"" (fileonly #orig) "\""))
  124.         (message #msg)
  125.         (run #cmd)
  126.     )
  127. )
  128.  
  129.  
  130. ; *********************** Check essential version numbers
  131. (if (< @installer-version (+ (* 65536 42) 9))
  132.     (abort #WRONG_INSTALLER_VERSION)
  133. )
  134.  
  135. (if (< (database "cpu") 68020 )
  136.     (abort #WRONG_CPU)
  137. )
  138.  
  139. (set os_version (/ (getversion "exec.library" (resident)) 65536))
  140. (if (< os_version 39)
  141.     (abort #WRONG_OS_VERSION)
  142. )
  143.  
  144. ; *********************** Is MUI installed
  145. (set muiinstall_required 0)
  146. (if (= (exists "MUI:" (noreq)) 0)
  147.     (
  148.         (set muiinstall_required 1)
  149.     )
  150.     (
  151.         (set mui_version (getversion "MUI:Libs/muimaster.library" ))
  152.         (if (< mui_version 1245219)
  153.             (
  154.                 (set muiinstall_required 1)
  155.             )
  156.         )
  157.     )
  158. )
  159.  
  160. (if (= muiinstall_required 1)
  161.     (abort #WRONG_MUI_VERSION)
  162. )
  163.  
  164. ; *********************** All essential versions are correct, continue installation
  165. (message #INITIAL_MESSAGE)
  166.  
  167. (complete 0)
  168.  
  169. ; *********************** Select original installation directory for update
  170. (set #notfound 1)
  171. (while #notfound
  172.     (
  173.         (set destination
  174.             (askdir
  175.                 (prompt #SELECT_PHOTOFOLIO_DIRECTORY)
  176.                 (help @askdir-help)
  177.                 (default @default-dest)
  178.             )
  179.         )
  180.  
  181.         (if (= (exists (tackon destination "PhotoFolio")) 1)
  182.             (
  183.                 (set #notfound 0)
  184.             )
  185.             (
  186.                 (message #NOT_FOUND_TRY_AGAIN)
  187.             )
  188.         )
  189.     )
  190. )
  191.  
  192. (set @default-dest destination)
  193.  
  194. ; *********************** Establish default MUI install location
  195. (if (= (exists "MUI:Libs/mui") 0)
  196.     (
  197.         (set #muipath (tackon destination "mui"))
  198.         (makedir #muipath)
  199.     )
  200.     (
  201.         (set #muipath "MUI:Libs/mui")
  202.     )
  203. )
  204.  
  205. ; *********************** Establish CPU type
  206. (set #ourcpu 0)
  207. (set #i 0)
  208. (while (set #thiscpu (select #i "68020" "68030" "68040" "68060" ""))
  209.     (
  210.         (if (= (database "cpu") #thiscpu) (set #ourcpu #i))
  211.         (set #i (+ #i 1))
  212.     )
  213. )
  214.  
  215. ; *********************** Is WarpOS installed
  216. (set #ppc 1) ; No PPC by default
  217.  
  218. (set warpos_version 0)
  219. (set warpos_version (getversion "warp.library" ))
  220. (if (> warpos_version 0)
  221.     (
  222.         (set #ppc 0)
  223.  
  224.         (set #ppc
  225.             (askchoice
  226.                 (help @askchoice-help)
  227.                 (prompt #PROMPT_INSTALL_PPC)
  228.                 (choices #YES #NO)
  229.                 (default #ppc)
  230.             )
  231.         )
  232.     )
  233. )
  234.  
  235. (complete 12)
  236.  
  237. ; *********************** Patch PhotoFolio to V2.1
  238. (makeassign "PHOTOFOLIO_DEST_TEMP" @default-dest)
  239. (P_patchfile "PhotoFolio21" "PhotoFolio" "PHOTOFOLIO_DEST_TEMP:" #PATCHING_PHOTOFOLIO_20)
  240. (makeassign "PHOTOFOLIO_DEST_TEMP")
  241.  
  242. (complete 24)
  243.  
  244. ; *********************** Install new imageio.library
  245. (P_copylib (select #ourcpu "Support/imageio.library/imageio.library_020" "Support/imageio.library/imageio.library_020" "Support/imageio.library/imageio.library_040" "Support/imageio.library/imageio.library_060") "LIBS:" "imageio.library")
  246.  
  247. (if (=
  248.     (askchoice
  249.         (help @askchoice-help)
  250.         (prompt #PROMPT_INSTALL_IMAGEIOPREFS)
  251.         (choices #YES #NO)
  252.         (default 0)
  253.     )    0 )
  254.     (
  255.         (copyfiles
  256.             (prompt #INSTALLING_IMAGEIOPREFS)
  257.             (source "Support/imageio.library")
  258.             (choices "ImageIOLibraryPrefs" "ImageIOLibraryPrefs.info" )
  259.             (help @copyfiles-help)
  260.             (dest @default-dest)
  261.             (files)
  262.             (noposition)
  263.             (optional askuser)
  264.             (confirm)
  265.         )
  266.     )
  267. )
  268.  
  269. (complete 36)
  270.  
  271. ; *********************** Install new jpeg.library
  272. (if (= #ppc 0)
  273.     (
  274.         ; PPC installed
  275.         (P_copylib "Support/jpeg.library/jpeg.library_wos" "LIBS:" "jpeg.library")
  276.     )
  277.     (
  278.         (P_copylib (select #ourcpu "Support/jpeg.library/jpeg.library_020std" "Support/jpeg.library/jpeg.library_020std" "Support/jpeg.library/jpeg.library_040std" "Support/jpeg.library/jpeg.library_060std") "LIBS:" "jpeg.library")
  279.     )
  280. )
  281.  
  282. (if (=
  283.     (askchoice
  284.         (help @askchoice-help)
  285.         (prompt #PROMPT_INSTALL_JPEGPREFS)
  286.         (choices #YES #NO)
  287.         (default 0)
  288.     )    0 )
  289.     (
  290.         (copyfiles
  291.             (prompt #INSTALLING_JPEGPREFS)
  292.             (source "Support/jpeg.library")
  293.             (choices "JpegLibraryPrefs" "JpegLibraryPrefs.info" )
  294.             (help @copyfiles-help)
  295.             (dest @default-dest)
  296.             (files)
  297.             (noposition)
  298.             (optional askuser)
  299.             (confirm)
  300.         )
  301.     )
  302. )
  303.  
  304. (complete 48)
  305.  
  306. ; *********************** Install new proof.library
  307. (P_copylib (select #ourcpu "Support/proof.library/proof.library_020" "Support/proof.library/proof.library_020" "Support/proof.library/proof.library_040" "Support/proof.library/proof.library_060") "LIBS:" "proof.library")
  308.  
  309. (complete 60)
  310.  
  311. ; *********************** Install imageprocess.library
  312. (if (= #ppc 0)
  313.     (
  314.         ; PPC installed
  315.         (P_copylib "Support/imageprocess.library/imageprocess.library_wos" "LIBS:" "imageprocess.library")
  316.     )
  317.     (
  318.         (P_copylib (select #ourcpu "Support/imageprocess.library/imageprocess.library_020" "Support/imageprocess.library/imageprocess.library_020" "Support/imageprocess.library/imageprocess.library_040" "Support/imageprocess.library/imageprocess.library_060") "LIBS:" "imageprocess.library")
  319.     )
  320. )
  321.  
  322. (complete 72)
  323.  
  324. ; *********************** Install locale catalog
  325. (set #localedest "LOCALE:Catalogs")
  326.  
  327. (if (<> #catalog 0)
  328.     (
  329.         (set #localesrc 1) ; Defaults to first entry
  330.         (set #i 0)
  331.         (while (set #thiscat (select #i "italiano" "deutsch" "español" "czech" "français" "nederlands" ""))
  332.             (
  333.                 (if (= #catalogname #thiscat)
  334.                     (
  335.                         (set #x #i)
  336.                         (while (> #x 0)
  337.                             (set #localesrc (* #localesrc 2))
  338.  
  339.                             (set #x (- #x 1))
  340.                         )
  341.                     )
  342.                 )
  343.  
  344.                 (set #i (+ #i 1))
  345.             )
  346.         )
  347.     )
  348.     (
  349.         (set #localesrc 0)
  350.     )
  351. )
  352.  
  353. (set #installcat
  354.     (askoptions
  355.         (prompt #PROMPT_INSTALL_CATALOG)
  356.         (choices "Italiano" "Deutsch" "Español" "Czech" "Français" "Nederlands")
  357.         (default #localesrc)
  358.         (help @askoptions-help)
  359.     )
  360. )
  361.  
  362. (set #i 0)
  363. (while (< #i 5)
  364.     (set #x #i)
  365.     (set #y 1)
  366.  
  367.     (while (> #x 0)
  368.         (set #y (* #y 2))
  369.  
  370.         (set #x (- #x 1))
  371.     )
  372.  
  373.     (if (bitand #installcat #y)
  374.         (
  375.             (set #localecat (select #i "Italiano" "Deutsch" "Español" "Czech" "Français" "Nederlands"))
  376.  
  377.             (copyfiles
  378.                 (prompt (cat (cat #INSTALLING_CATALOG " " ) #localecat))
  379.                 (help @copyfiles-help)
  380.                 (source (tackon "Catalogs" #localecat))
  381.                 (choices "PhotoFolio.catalog")
  382.                 (dest (tackon #localedest #localecat))
  383.                 (confirm)
  384.                 (optional askuser)
  385.                 (files)
  386.             )
  387.         )
  388.     )
  389.  
  390.     (set #i (+ #i 1))
  391. )
  392.  
  393. (complete 84)
  394.  
  395. ; *********************** Rename original MUI prefs files and delete key file
  396. (message #UPDATING_MUI_PREFS)
  397.  
  398. (if (<> (exists "ENV:mui/PHOTOFOLIO.1.prefs" (noreq)) 0)
  399.     (
  400.         (run "C:Rename FROM=ENV:mui/PHOTOFOLIO.1.prefs TO=ENV:mui/PHOTOFOLIO.prefs")
  401.     )
  402. )
  403.  
  404. (if (<> (exists "ENVARC:mui/PHOTOFOLIO.1.prefs" (noreq)) 0)
  405.     (
  406.         (run "C:Rename FROM=ENVARC:mui/PHOTOFOLIO.1.prefs TO=ENVARC:mui/PHOTOFOLIO.prefs")
  407.     )
  408. )
  409.  
  410. (set #keyfile (tackon @default-dest "photofolio.key"))
  411. (run (cat "C:Delete \"" #keyfile "\" QUIET"))
  412.  
  413. (complete 96)
  414.  
  415. ; *********************** Add the photofolio assign
  416. (startup "PhotoFolio - (C) Steeple Software"
  417.     (prompt #PHOTOFOLIO_ASSIGN)
  418.     (help @startup-help)
  419.     (command "C:Assign PhotoFolio: \"" @default-dest "\"\n")
  420. )
  421. (makeassign "PhotoFolio" @default-dest)
  422.  
  423. (complete 100)
  424.  
  425. ; *********************** Finished
  426. (message (cat #UPDATE_COMPLETED))
  427.